<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./index.css">




</head>

<body>
    <div class="box">
        <!-- 图片 -->
        <div class="img_box">
            <!-- 图片列表 -->
            <ul>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
            </ul>
            <div class="mainBox"></div>
            <!-- 左右箭头 -->
            <div class="arrow_left">&lt;</div>
            <div class="arrow_right">&gt;</div>
        </div>
        <!-- 小圆点 -->
        <div class="dot_box">
            <span class="" data-index="1"></span>
            <span data-index="2"></span>
            <span data-index="3"></span>
            <span data-index="4"></span>
        </div>
    </div>
    <script src="./index2.js"></script>
    <script src="./packageAjax.js"></script>
    <script>
        let mainBox = document.querySelector("li");
        
        ajax("get", "http://studentback.dfbuff.xyz/getMethod", function (res) {
            // console.log(res.result);
            res.result.forEach(function (item) {
                console.log(item);
                let newImg = document.createElement("img");
                newImg.setAttribute("src", item.content);
                newImg.setAttribute("width", 500);
                mainBox.appendChild(newImg);
            })
        }, {
                "type": "图片"
            });
    </script>
</body>

</html>